package Behavioral_design_pattern.Observer_Pattern;

import java.util.ArrayList;

// 抽象主体
public abstract class MySubject {
    protected ArrayList observers = new ArrayList();
    public void attach(MyObserver obs){
        observers.add(obs);
    }

    public void detach(MyObserver obs){
        observers.remove(obs);
    }

    public abstract void cry();
}
